package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_luckybag", schema = "", catalog = "onedollar")
public class TLuckybagEntity {
    private int id;
    private Double total;
    private Double available;
    private Integer totalcount;
    private Integer availablecount;
    private String content;
    private Timestamp sendtime;
    private Timestamp endtime;
    private Integer sender;
    private Integer type;
    private String serialnumber;
    private String consumerphone;

    @Id
    @GeneratedValue
    @Column(name = "id", nullable = false, insertable = false, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "total", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getTotal() {
        return total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }

    @Basic
    @Column(name = "available", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getAvailable() {
        return available;
    }

    public void setAvailable(Double available) {
        this.available = available;
    }

    @Basic
    @Column(name = "totalcount", nullable = true, insertable = true, updatable = true)
    public Integer getTotalcount() {
        return totalcount;
    }

    public void setTotalcount(Integer totalcount) {
        this.totalcount = totalcount;
    }

    @Basic
    @Column(name = "availablecount", nullable = true, insertable = true, updatable = true)
    public Integer getAvailablecount() {
        return availablecount;
    }

    public void setAvailablecount(Integer availablecount) {
        this.availablecount = availablecount;
    }

    @Basic
    @Column(name = "content", nullable = true, insertable = true, updatable = true, length = 50)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "sendtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getSendtime() {
        return sendtime;
    }

    public void setSendtime(Timestamp sendtime) {
        this.sendtime = sendtime;
    }

    @Basic
    @Column(name = "endtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getEndtime() {
        return endtime;
    }

    public void setEndtime(Timestamp endtime) {
        this.endtime = endtime;
    }

    @Basic
    @Column(name = "sender", nullable = true, insertable = true, updatable = true)
    public Integer getSender() {
        return sender;
    }

    public void setSender(Integer sender) {
        this.sender = sender;
    }

    @Basic
    @Column(name = "type", nullable = true, insertable = true, updatable = true)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "serialnumber", nullable = true, insertable = true, updatable = true, length = 64)
    public String getSerialnumber() {
        return serialnumber;
    }

    public void setSerialnumber(String serialnumber) {
        this.serialnumber = serialnumber;
    }

    @Basic
    @Column(name = "consumerphone", nullable = true, insertable = true, updatable = true, length = 20)
    public String getConsumerphone() {
        return consumerphone;
    }

    public void setConsumerphone(String consumerphone) {
        this.consumerphone = consumerphone;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TLuckybagEntity that = (TLuckybagEntity) o;

        if (id != that.id) return false;
        if (total != null ? !total.equals(that.total) : that.total != null) return false;
        if (available != null ? !available.equals(that.available) : that.available != null) return false;
        if (totalcount != null ? !totalcount.equals(that.totalcount) : that.totalcount != null) return false;
        if (availablecount != null ? !availablecount.equals(that.availablecount) : that.availablecount != null)
            return false;
        if (content != null ? !content.equals(that.content) : that.content != null) return false;
        if (sendtime != null ? !sendtime.equals(that.sendtime) : that.sendtime != null) return false;
        if (endtime != null ? !endtime.equals(that.endtime) : that.endtime != null) return false;
        if (sender != null ? !sender.equals(that.sender) : that.sender != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (serialnumber != null ? !serialnumber.equals(that.serialnumber) : that.serialnumber != null) return false;
        if (consumerphone != null ? !consumerphone.equals(that.consumerphone) : that.consumerphone != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (total != null ? total.hashCode() : 0);
        result = 31 * result + (available != null ? available.hashCode() : 0);
        result = 31 * result + (totalcount != null ? totalcount.hashCode() : 0);
        result = 31 * result + (availablecount != null ? availablecount.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (sendtime != null ? sendtime.hashCode() : 0);
        result = 31 * result + (endtime != null ? endtime.hashCode() : 0);
        result = 31 * result + (sender != null ? sender.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (serialnumber != null ? serialnumber.hashCode() : 0);
        result = 31 * result + (consumerphone != null ? consumerphone.hashCode() : 0);
        return result;
    }
}
